<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri= "http://java.sun.com/jsp/jstl/fmt" prefix= "fmt" %>
<%@ include file="/inc/css.inc"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>帖子列表</title>
		<link rel="stylesheet" href="${css}/amazeui.css" />
		<link rel="stylesheet" href="${css}/bbs.css" />
		<script src="https://cdn.bootcss.com/jquery/2.2.2/jquery.js"></script>
	</head>
	<script type="text/javascript">
		$(function(){
			var cookieVal = localStorage.patientid;  //获取 local storage 
			if( typeof (cookieVal)  ==  "undefined" || cookieVal ==  undefined){
				window.location.href = "<%=basePath%>/web/enrollment/joyin/letter.jsp?a=selectAllForumPost";
			}else{
				$("#logindiv").show();
			}
		});
	</script>
	<body id="logindiv" style="display:none">
		<div class="warp">
			<ul>
				<div class="item-image"><img width="100%" src="${img}/bbsbanner.png"></div>
				<c:forEach items="${forumPostList}" var="f">
					<li>
						<a href="selectDetailsForumPost.action?id=${f.id}">
						<div class="item-title">${f.forumName}</div>
						<div class="item-info">${f.forumContent}</div>
						<div class="item-time">发布：<fmt:formatDate value="${f.createDate}" type="both" pattern="yyyy-MM-dd HH:mm"/></div></a>
					</li>
				</c:forEach>
			</ul>	
		</div>
		<script src="https://cdn.bootcss.com/jQuery.dotdotdot/1.7.4/jquery.dotdotdot.js"></script>
		<script>
			$(document).ready(function() {
				$(".item-info").dotdotdot();
			});
		</script>
	</body>
</html>
